<template>
  <div>
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="item of banner" :key="item.id">
        <img :src="item.imgUrl" alt="" />
      </van-swipe-item>
    </van-swipe>
  </div>
</template>
 
<script>
import Vue from "vue";
import { Swipe, SwipeItem } from "vant";

Vue.use(Swipe);
Vue.use(SwipeItem);
export default {
  data() {
    return {
      banner: [],
    };
  },
  methods: {},
  mounted() {
    this.$http("http://47.108.197.28:4000/api/banner").then((res) => {
      this.banner = res.data.res;
    });
  },
};
</script> 
<style scoped>
.my-swipe .van-swipe-item > img {
  width: 100%;
  height: 400px;
}
</style>